# Contributor: Petr Hodina <phodina@protonmail.com>
# Maintainer: Petr Hodina <phodina@protonmail.com>
pkgname=hdr10plus-tool
pkgver=1.6.0
pkgrel=0
pkgdesc="CLI utility to work with HDR10+ in HEVC files"
url="https://github.com/quietvoid/hdr10plus_tool"
# arm: fails tests
# loongarch64: blocked by libc crate
arch="all !armhf !armv7 !loongarch64"
license="MIT"
makedepends="cargo cargo-auditable fontconfig-dev"
checkdepends="font-opensans"
source="$pkgname-$pkgver.tar.gz::https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/$pkgver.tar.gz"
builddir=$srcdir/hdr10plus_tool-$pkgver
options="net" # cargo fetch

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen --release
}

package() {
	install -Dm755 target/release/hdr10plus_tool -t "$pkgdir"/usr/bin/
}

sha512sums="
bee366c7f2e85274bc5d231e31c4b2662424a754500c4cc6eeb7621cdb3cf66c55eb008957bff080792c513cbee989644d4c2e56159398d90845af42fd935026  hdr10plus-tool-1.6.0.tar.gz
"
